<template>
    <div>
        <div class="lunbo">
            <van-swipe @change="onChange">
            <van-swipe-item><img src="../../../public/2.webp" alt=""></van-swipe-item>
             <van-swipe-item><img src="../../../public/7.webp" alt=""></van-swipe-item>
            <template #indicator>
    <div class="custom-indicator">{{ current + 1 }}/2</div>
  </template>
</van-swipe>
        </div>
    </div>
</template>

<script>
import Vue from 'vue';
import { Swipe, SwipeItem } from 'vant';

Vue.use(Swipe);
Vue.use(SwipeItem);
export default {
     data() {
    return {
      current: 0,
    };
  },
  methods: {
    onChange(index) {
      this.current = index;
    },
  },
}
</script>

<style scoped>
    .lunbo{
        width: 100%;
        height: 5rem;
        background-color: red;
    }
    .custom-indicator {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 2px 5px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.1);
  }
  .lunbo img{
      width: 100%;
      height: 5rem;
  }
</style>
